export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
  ID: string;
  String: string;
  Boolean: boolean;
  Int: number;
  Float: number;
  Duration: string;
  Time: string;
};

export type AggregationDataPayload = {
  __typename?: 'AggregationDataPayload';
  aggregationType: Scalars['String'];
  value: Scalars['Float'];
};

export type AggregationQuery = {
  aggregationTypes: Array<InputMaybe<AggregationType>>;
  endTime: Scalars['String'];
  params: Array<ParamQueryInput>;
  startTime: Scalars['String'];
  tailNo: Scalars['String'];
};

export type AggregationResultPayload = {
  __typename?: 'AggregationResultPayload';
  param: ParamPayload;
};

export enum AggregationType {
  Avg = 'AVG',
  Max = 'MAX',
  Mean = 'MEAN',
  Min = 'MIN',
  Std = 'STD'
}

export type AircraftAtaAlertCountPayload = {
  __typename?: 'AircraftAtaAlertCountPayload';
  aircraftId: Scalars['String'];
  ata: AtaPayload;
  count: Scalars['Int'];
};

export type AircraftAtaModelAlertCountPayload = {
  __typename?: 'AircraftAtaModelAlertCountPayload';
  aircraftId: Scalars['String'];
  ata: AtaPayload;
  count: Scalars['Int'];
  lastAlert?: Maybe<AlertPayload>;
  model: PdmModelPayload;
  summaryGraphs?: Maybe<Array<Graph>>;
  trendGraphs?: Maybe<Array<Graph>>;
};

export type AircraftConnection = {
  __typename?: 'AircraftConnection';
  data: Array<AircraftPayload>;
  page: PageInfo;
  totalCount: Scalars['Int'];
};

export type AircraftPayload = {
  __typename?: 'AircraftPayload';
  aircraftType: Scalars['String'];
  airlineId: Scalars['String'];
  ataAlertCounts?: Maybe<Array<AircraftAtaAlertCountPayload>>;
  ataModelAlertCounts?: Maybe<Array<AircraftAtaModelAlertCountPayload>>;
  flights: Array<FlightPayload>;
  id: Scalars['String'];
  lastAlert?: Maybe<AlertPayload>;
  msn: Scalars['String'];
  myAttention?: Maybe<AttentionPayload>;
  productionDate: Scalars['Time'];
  tailNo: Scalars['String'];
};


export type AircraftPayloadAtaAlertCountsArgs = {
  lastDayNum?: InputMaybe<Scalars['Int']>;
  statuses?: InputMaybe<Array<AlertStatus>>;
};


export type AircraftPayloadAtaModelAlertCountsArgs = {
  lastDayNum?: InputMaybe<Scalars['Int']>;
  statuses?: InputMaybe<Array<AlertStatus>>;
};


export type AircraftPayloadFlightsArgs = {
  CurrentMonth?: InputMaybe<Scalars['String']>;
  CurrentYear?: InputMaybe<Scalars['String']>;
};

export type AircraftQuery = {
  airlineId: Scalars['String'];
  page?: InputMaybe<Scalars['Int']>;
  pageSize?: InputMaybe<Scalars['Int']>;
};

export type AirlineModelPayload = {
  __typename?: 'AirlineModelPayload';
  airlineId: Scalars['String'];
  airlineModelAlertCount: Scalars['Int'];
  model: PdmModelPayload;
  modelAircraftAlerts?: Maybe<Array<ModelAircraftAlertsPayload>>;
  myAttention?: Maybe<AttentionPayload>;
  mySubscription?: Maybe<ModelSubscriptionPayload>;
  summaryGraphs?: Maybe<Array<Graph>>;
  unprocessedAlertCount: Scalars['Int'];
};


export type AirlineModelPayloadAirlineModelAlertCountArgs = {
  lastDayNum?: InputMaybe<Scalars['Int']>;
  statuses?: InputMaybe<Array<AlertStatus>>;
};


export type AirlineModelPayloadUnprocessedAlertCountArgs = {
  lastDayNum?: InputMaybe<Scalars['Int']>;
};

export type AirlinePayload = {
  __typename?: 'AirlinePayload';
  aircrafts?: Maybe<Array<AircraftPayload>>;
  airlineModel?: Maybe<AirlineModelPayload>;
  airlineModels: Array<AirlineModelPayload>;
  code: Scalars['String'];
  hotAirlineModels: Array<AirlineModelPayload>;
  id: Scalars['ID'];
  logoUrl?: Maybe<Scalars['String']>;
  name: Scalars['String'];
};


export type AirlinePayloadAirlineModelArgs = {
  modelId: Scalars['String'];
};


export type AirlinePayloadHotAirlineModelsArgs = {
  limit: Scalars['Int'];
};

export type AirportPayload = {
  __typename?: 'AirportPayload';
  city: Scalars['String'];
  code: Scalars['String'];
  id: Scalars['String'];
  name: Scalars['String'];
};

export type AlertConnection = {
  __typename?: 'AlertConnection';
  data: Array<AlertPayload>;
  page: PageInfo;
  totalCount: Scalars['Int'];
};

export type AlertPayload = {
  __typename?: 'AlertPayload';
  aircraft: AircraftPayload;
  airline: AirlinePayload;
  ataId: Scalars['String'];
  id: Scalars['ID'];
  modelId: Scalars['String'];
  occurAt?: Maybe<Scalars['Time']>;
  status: AlertStatus;
};

export type AlertQuery = {
  airlineId: Scalars['String'];
  lastDayNum?: InputMaybe<Scalars['Int']>;
  modelId: Scalars['String'];
  page?: InputMaybe<Scalars['Int']>;
  pageSize?: InputMaybe<Scalars['Int']>;
  statuses?: InputMaybe<Array<AlertStatus>>;
};

export type AlertResetRecordPayload = {
  __typename?: 'AlertResetRecordPayload';
  airlineId: Scalars['String'];
  id: Scalars['String'];
  lastAlert: AlertPayload;
  occurAt: Scalars['Time'];
  resetType: AlertResetType;
  suggestion?: Maybe<Scalars['String']>;
  userId: Scalars['String'];
};

export enum AlertResetType {
  Close = 'CLOSE',
  Monitoring = 'MONITORING',
  Open = 'OPEN'
}

export enum AlertStatus {
  Close = 'CLOSE',
  Monitoring = 'MONITORING',
  Open = 'OPEN'
}

export type AtaPayload = {
  __typename?: 'AtaPayload';
  code: Scalars['String'];
  color: Scalars['String'];
  id: Scalars['String'];
  name: Scalars['String'];
};

export type AtasPayload = {
  __typename?: 'AtasPayload';
  code: Scalars['String'];
  name: Scalars['String'];
  params: Array<DecodeParamPayload>;
};

export type AttentionPayload = {
  __typename?: 'AttentionPayload';
  aircraft?: Maybe<AircraftPayload>;
  airlineId: Scalars['String'];
  airlineModelLastAlert?: Maybe<AlertPayload>;
  id: Scalars['String'];
  model?: Maybe<PdmModelPayload>;
  status: LifecycleStatus;
  targetId: Scalars['String'];
  targetType: AttentionTargetType;
};

export enum AttentionTargetType {
  Aircraft = 'AIRCRAFT',
  PdmModel = 'PDM_MODEL'
}

export type DecodeParamPayload = {
  __typename?: 'DecodeParamPayload';
  desc: Scalars['String'];
  name: Scalars['String'];
  quality: Array<Scalars['String']>;
};

export type DepartmentPayload = {
  __typename?: 'DepartmentPayload';
  code: Scalars['String'];
  id: Scalars['ID'];
  name: Scalars['String'];
};

export type FlightPayload = {
  __typename?: 'FlightPayload';
  aircraftId: Scalars['String'];
  decodeRecord: Scalars['String'];
  id: Scalars['String'];
  landingAirport: AirportPayload;
  landingAirportId: Scalars['String'];
  landingTime: Scalars['Time'];
  takeoffAirport: AirportPayload;
  takeoffAirportId: Scalars['String'];
  takeoffTime: Scalars['Time'];
};

export type Graph = {
  __typename?: 'Graph';
  title: Scalars['String'];
  url: Scalars['String'];
};

export enum LifecycleStatus {
  Disabled = 'DISABLED',
  Enabled = 'ENABLED'
}

export type ModelAircraftAlertsPayload = {
  __typename?: 'ModelAircraftAlertsPayload';
  aircraft: AircraftPayload;
  lastAlert?: Maybe<AlertPayload>;
  modelId: Scalars['String'];
  unprocessedAlertCount: Scalars['Int'];
};

export type ModelSubscriptionPayload = {
  __typename?: 'ModelSubscriptionPayload';
  id: Scalars['String'];
  modelId: Scalars['String'];
  status: LifecycleStatus;
  userId: Scalars['String'];
};

export type Mutation = {
  __typename?: 'Mutation';
  followTarget: AttentionPayload;
  subscribeMode: ModelSubscriptionPayload;
  unfollowTarget: AttentionPayload;
  unsubscribeMode: ModelSubscriptionPayload;
};


export type MutationFollowTargetArgs = {
  targetId: Scalars['String'];
  targetType: AttentionTargetType;
};


export type MutationSubscribeModeArgs = {
  modelId: Scalars['String'];
};


export type MutationUnfollowTargetArgs = {
  attentionId: Scalars['String'];
};


export type MutationUnsubscribeModeArgs = {
  modelSubscriptionId: Scalars['String'];
};

export type PageInfo = {
  __typename?: 'PageInfo';
  page: Scalars['Int'];
  pageSize: Scalars['Int'];
};

export type ParamAggregationPayload = {
  __typename?: 'ParamAggregationPayload';
  endTime: Scalars['String'];
  result: Array<AggregationResultPayload>;
  startTime: Scalars['String'];
  tailNo: Scalars['String'];
};

export type ParamDataPayload = {
  __typename?: 'ParamDataPayload';
  FailedReason: Scalars['String'];
  dataProvider: Scalars['String'];
  dataSource: Scalars['String'];
  flight: FlightPayload;
  flightId: Scalars['String'];
  id: Scalars['ID'];
  metric: DecodeParamPayload;
  metricCode: Scalars['String'];
  processStatus: ProcessStatus;
};

export type ParamDataQuery = {
  flightIds: Array<InputMaybe<Scalars['String']>>;
  params: Array<ParamQueryInput>;
};

export type ParamPayload = {
  __typename?: 'ParamPayload';
  expr: Scalars['String'];
  type: Scalars['String'];
  values: Array<AggregationDataPayload>;
};

export type ParamQueryInput = {
  expr: Scalars['String'];
  type: ParamType;
};

export enum ParamType {
  Custom = 'Custom',
  Field = 'Field'
}

export type ParamsQuery = {
  aircraftId: Scalars['String'];
  endTime: Scalars['String'];
  startTime: Scalars['String'];
};

export type PdmModelPayload = {
  __typename?: 'PdmModelPayload';
  ataIds: Array<Maybe<Scalars['String']>>;
  code: Scalars['String'];
  icon: Scalars['String'];
  id: Scalars['String'];
  name: Scalars['String'];
  shortName: Scalars['String'];
};

export enum ProcessStatus {
  Completed = 'COMPLETED',
  Failed = 'FAILED',
  InProgress = 'IN_PROGRESS',
  Pending = 'PENDING'
}

export type Query = {
  __typename?: 'Query';
  aircraft: AircraftPayload;
  aircrafts: Array<AircraftPayload>;
  airline: AirlinePayload;
  airlines: Array<AirlinePayload>;
  alerts?: Maybe<AlertConnection>;
  atasParams?: Maybe<Array<AtasPayload>>;
  me: UserPayload;
  myAlertResetRecords?: Maybe<Array<AlertResetRecordPayload>>;
  myAttentions?: Maybe<Array<AttentionPayload>>;
  paramAggregation: ParamAggregationPayload;
  paramsData?: Maybe<Array<ParamDataPayload>>;
};


export type QueryAircraftArgs = {
  id: Scalars['String'];
};


export type QueryAirlineArgs = {
  id: Scalars['String'];
};


export type QueryAlertsArgs = {
  query: AlertQuery;
};


export type QueryAtasParamsArgs = {
  query: ParamsQuery;
};


export type QueryMyAlertResetRecordsArgs = {
  airlineId: Scalars['String'];
};


export type QueryMyAttentionsArgs = {
  airlineId: Scalars['String'];
};


export type QueryParamAggregationArgs = {
  query: AggregationQuery;
};


export type QueryParamsDataArgs = {
  query: ParamDataQuery;
};

export type UserAirlinePayload = {
  __typename?: 'UserAirlinePayload';
  airline: AirlinePayload;
  department?: Maybe<DepartmentPayload>;
  id: Scalars['ID'];
  userId: Scalars['String'];
};

export type UserManagedAirlinePayload = {
  __typename?: 'UserManagedAirlinePayload';
  airline: AirlinePayload;
  id: Scalars['ID'];
  userId: Scalars['String'];
};

export type UserPayload = {
  __typename?: 'UserPayload';
  id: Scalars['ID'];
  name: Scalars['String'];
  userAirlines?: Maybe<Array<UserAirlinePayload>>;
  userManagedAirlines?: Maybe<Array<UserManagedAirlinePayload>>;
};
